package com.dq.controller.user;

import com.dq.controller.in.user.SysUserQuery;
import com.dq.domain.sys.user.user.BossUser;
import com.dq.exception.customException.AdminException;
import com.dq.service.AllService;
import com.dq.vo.ListDataVo;
import com.dq.vo.Vo;
import com.dq.vo.baseVo.VO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author cf
 */

@RestController
@RequestMapping("/sys/bossuser/")
@Api(description = "管理者用户管理")
public class SysBossUserController extends AllService {

    @PostMapping("proUserListAll")
    @ApiOperation("省总角色所有用户列表")
    public Vo proUserListAll(@RequestBody SysUserQuery sysUserQuery)throws AdminException {
        List<BossUser> list = bossUserService.getBossUserListByRoles(sysUserQuery, 1);
        return new ListDataVo((List<BossUser.Vo>) VO.toVOCollection(list));
    }
}
